<!DOCTYPE HTML>
<html>
<head>
<include file="Include:meta" />
<title>经营数据分析-目的地运营集团数据管理平台</title>
<include file="Include:style" />
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text"><if condition="$project['info_id'] neq NULL">商务跟进</if>项目 > [{$project['project_num']}]{$project['project_name']} > 经营数据分析</div>
	</div>
	<div id="content">
		<include file="Include:project_header" />
		<div class="filter">
			<div class="filter-item">
				<div class="filter-title">显示方式：</div>
				<ul class="filter-order">
					<li <if condition="$types eq '图表'">class="current"</if>>
						<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/图表/mon/全部">图表</a>
					</li>
					<li <if condition="$types eq '列表'">class="current"</if>>
						<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/列表/mode/折叠">列表</a>
					</li>
				</ul>
			</div>
			<if condition="$types eq '图表'">
				<div class="filter-item">
					<div class="filter-title">内容分类：</div>
					<ul class="filter-order">
						<li <if condition="$mon eq '全部收入'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/图表/mon/全部收入">全部收入</a>
						</li>
						<li <if condition="$mon eq '门票'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/图表/mon/门票">门票</a>
						</li>
						<li <if condition="$mon eq '二消'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/图表/mon/二消">二消</a>
						</li>
						<li <if condition="$mon eq '成本'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/图表/mon/成本">成本</a>
						</li>
					</ul>
				</div>
			<else/>
				<div class="filter-item">
					<div class="filter-title">方式分类：</div>
					<ul class="filter-order">
						<li <if condition="$mode eq '折叠'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/列表/mode/折叠">折叠</a>
						</li>
						<li <if condition="$mode eq '展开'">class="current"</if>>
							<a href="__APP__/Project/project_operate_analysis/id/{$project['id']}/types/列表/mode/展开">展开</a>
						</li>
					</ul>
				</div>
			</if>
		</div>
		<if condition="$types eq '图表'">
			<div class="form-main">
				<div id="echarts" style="width: 100%;height:500px; margin-top: 50px"></div>
			</div>
		<else/>
			<div class="table-scrollx">
				<table class="table table-bordered table-hover">
					<tr class="table-header fixed-table-header">
						<td width="300">期数</td>
						<td colspan="2">门票金额(元)</td>
						<td colspan="2">二消金额(元)</td>
						<td>总收入(元)</td>
						<td colspan="2">成本(元)</td>
					</tr>
					<if condition="$all eq NULL">
					<tr><td class='text-center' colspan="8">暂无相关内容</td></tr>
					</if>
					<if condition="$mode eq '折叠'">
						<foreach name="all" item="ao">
							<tr>
								<td>{$ao['week']}</td>
								<td colspan="2">{$ao['mp_sum']}</td>
								<td colspan="2">{$ao['ec_sum']}</td>
								<td>{$ao['all_sum']}</td>
								<td>{$ao['cb_sum']}</td>
							</tr>
						</foreach>
					<else/>
						<foreach name="all" item="ao" >
							<tr>
								<td <if condition="$ao['mp_max'] gt $ao['ec_max']">rowspan="{$ao['mp_max']+1}"<else/>rowspan="{$ao['ec_max']+1}"</if>>{$ao['week']}</td>
								<td><b>门票合计</b></td>
								<td>{$ao['mp_sum']}</td>
								<td><b>二消合计</b></td>
								<td>{$ao['ec_sum']}</td>
								<td <if condition="$ao['mp_max'] gt $ao['ec_max']">rowspan="{$ao['mp_max']+1}"<else/>rowspan="{$ao['ec_max']+1}"</if>>{$ao['all_sum']}</td>
							</tr>
							<foreach name="ao['detail']" item="xo" >
							<tr>
								<if condition="$xo['mp_name'] eq NULL">
									<td colspan="2"></td>
								<else/>
									<td>{$xo['mp_name']}</td>
									<td>{$xo['mp_sum']}</td>
								</if>
								<if condition="$xo['ec_name'] eq NULL">
									<td colspan="2"></td>
								<else/>
									<td>{$xo['ec_name']}</td>
									<td>{$xo['ec_sum']}</td>
								</if>
								<if condition="$xo['cb_name'] eq NULL">
									<td colspan="2"></td>
								<else/>
									<td>{$xo['cb_name']}</td>
									<td>{$xo['cb_sum']}</td>
								</if>
							</tr>
							</foreach>
						</foreach>
					</if>
				</table>
			</div>
		</if>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript" src="__PUBLIC__/js/echarts.min.js"></script>
<script type="text/javascript">
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById('echarts'));
	// 指定图表的配置项和数据
	var myarray={:json_encode($name)};
	var sumss={:json_encode($sumss)};
	var series=[];
	for(var i = 0;i<myarray.length;i++){
		var sd = sumss[i].split(",")
		console.log(sd);
		series.push({
			name: myarray[i],
			type: 'line',
			label: {
				normal: {
					show: true,
					position: 'top'
				}
			},
			data: sd
		});
	}
	var option = {
		title: {
			text: '经营数据',
			subtext: '分析图'
		},
		toolbox: {
			show : true,
			feature : {
				magicType : {show: true, type: ['line', 'bar']},
				restore : {show: true},
				saveAsImage : {show: true}
			}
		},
		color: [{$color}],
		tooltip : {
			trigger: 'axis',
			axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
			}
		},
		legend: {
			data:[{$legend}]
		},
		grid: {
			left: '3%',
			right: '4%',
			bottom: '3%',
			containLabel: true
		},
		xAxis : [
			{
				type : 'category',
				data : [{$weeks}],
				axisTick: {
					alignWithLabel: true
				}
			}
		],
		yAxis : [
			{
				type : 'value'
			}
		],
		"grid": {
			"borderWidth": 0,
			"top": 110,
			"bottom": 115,
			textStyle: {
				color: "#fff"
			}
		},
		"dataZoom": [{
			"show": true,
			"height": 30,
			"xAxisIndex": [
				0
			],
			bottom: 30,
			"start": {$star},
			"end": 100,
			
			handleSize: '110%',
			handleStyle:{
				color:"#f49900",
				
			},
			textStyle:{
				color:"#000"},
			borderColor:"#fff"
			
			
		},{
			"type": "inside",
			"show": true,
			"height": 15,
			"start": 1,
			"end": 35
		}],
		series : series
	};
	window.onresize = myChart.resize;
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(option);
</script>
</body>
</html>